﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace ClassLibrary.Configuration
{
    public static class Configuration
    {
        public static object GetConfiguration(String filePath, Type configType)
        {
            object config;
            var reader = new XmlSerializer(configType);

            using (var file = File.OpenRead(filePath))
            {
                config = reader.Deserialize(file);
            }

            return config;
        }
    }
}
